import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { MongooseModule } from '@nestjs/mongoose';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user/user.module';
import { IntegralModule } from './integral/integral.module';
import { AuthModule } from './auth/auth.module';
import { MailModule } from './mail/mail.module';
import { VerificationModule } from './verification/verification.module';
import { RedisModule } from './redis/redis.module';
import mailConfig from './config/mail.config';
import redisConfig from './config/redis.config';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      load: [mailConfig, redisConfig],
    }),
    MongooseModule.forRoot(process.env.MONGODB_URI),
    UserModule,
    IntegralModule,
    AuthModule,
    MailModule,
    VerificationModule,
    RedisModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
